<?php

session_start();

//require('FPDF/fpdf.php');
require('Models/pdf.php');
require('FPDF/TFPDF/tfpdf.php');
require('contrat_location.php');

//Le PDF se passe d'explication puisqu'il ne s'agit que d'affichages.

//Instanciation of inherited class
$pdf = new tFPDF();

$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->AddFont('DejaVu','B','DejaVuSans-Bold.ttf',true);
$pdf->AddPage();
$pdf->SetFont('DejaVu','BU',16);
$pdf->Cell(0,5,$contrat["Title"],0,1,'C');
$pdf->SetFont('DejaVu','',11);
$pdf->Ln(5);
$pdf->MultiCell(0,5,$contrat["Law"],0,'C');
$pdf->Ln(5);
$pdf->MultiCell(0,5,$contrat["People"],1);
$pdf->Ln(6);
$pdf->SetFont('DejaVu','BU',10);
$pdf->Cell(0,5,$contrat["Stopped1"],0,1);
$pdf->SetFont('DejaVu','B',10);
$pdf->MultiCell(0,5,$contrat["Stopped2"],0);
$pdf->Ln(6);
$pdf->SetFont('DejaVu','',11);
$pdf->MultiCell(0,5,$contrat["Description"],1);
$pdf->Ln(5);
$pdf->MultiCell(0,5,$contrat["Duration"],1);
$pdf->Ln(4);
$pdf->SetFont('DejaVu','',10);
$pdf->MultiCell(0,5,$contrat["Conclusion"],0);

$pdf->Ln(3);
$pdf->SetFont('DejaVu','B',11);
$pdf->Cell(63,10,$contrat["Owner"],0,0,'C');
$pdf->Cell(63,10,$contrat["Client"],0,0,'C');
$pdf->Cell(63,10,$contrat["Caution"],0,0,'C');
$pdf->Ln(5);
$pdf->SetFont('DejaVu','',9);
for ($i = 0; $i <= 2; $i++)
{
	$pdf->Cell(63,10,$contrat["Signature1"],0,0,'C');
}
$pdf->Ln(4);
for ($i = 0; $i <= 2; $i++)
{
	$pdf->Cell(63,10,$contrat["Signature2"],0,0,'C');
}
$pdf->Ln(4);
for ($i = 0; $i <= 2; $i++)
{
	$pdf->Cell(63,10,$contrat["Signature3"],0,0,'C');
}

$pdf->Ln(6);
if (isset($_GET["id"]) && isGoodAlert($alerts,$_GET["id"],"Yloc"))
{
	$pdf->Cell(63,10,$contrat["SignatureOk"],0,0,'C');
	$pdf->Cell(63,10,$contrat["SignatureOk"],0,0,'C');
	$pdf->Cell(63,10,$contrat["SignatureOk"],0,0,'C');
}
$pdf->Ln(4);
if (isset($_GET["id"]) && isGoodAlert($alerts,$_GET["id"],"Yloc"))
{
	$pdf->Cell(63,10,$datas["owner"]->nom.' '.$datas["owner"]->prenom,0,0,'C');
	$pdf->Cell(63,10,$datas["client"]->nom.' '.$datas["client"]->prenom,0,0,'C');
	$pdf->Cell(63,10,$datas["client"]->nom.' '.$datas["client"]->prenom,0,0,'C');
}
$pdf->Output();
?>
